<%-- 
    Document   : index
    Created on : Oct 16, 2012, 10:31:31 PM
    Author     : DinhThang
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>JSP Page</title>
        <link rel="stylesheet" type="text/css" href="/MantechHelpdesk/styles/style.css" />
    </head>
    <body>

        <f:view>
            <jsp:include page="includes/incHeader.jsp" flush="false" />
            <h:commandLink value="Change Pass" action="#{usersBean.prepareData4ChangePass}">
                <f:param name="idParam" value="#{login.userid}"/>
            </h:commandLink>
            <h:form>
                <div id="articlesList">
                    <t:dataList value="#{articlesBean.articlesList}" var="article" rendered="#{not empty departmentsBean.deparList}">
                        <div class="artTitle">
                            <h:commandLink value="#{article.title}" action="#{articlesBean.prepareData4View}">
                                <f:param name="idParam" value="#{article.articleID}"/>
                            </h:commandLink>

                        </div>                
                        <div class="artDes"><h:outputText value="#{article.describe}"/></div>                
                    </t:dataList>
                </div>
                <br />
                <center>
                    <t:dataList value="#{articlesBean.pages}" var="page">
                        <h:commandLink value="#{page}" actionListener="#{articlesBean.page}"
                                       rendered="#{page != articlesBean.currentPage}" />
                        <h:outputText value="<b>#{page}</b>" escape="false"
                                      rendered="#{page == articlesBean.currentPage}" />
                    </t:dataList><br />
                    <h:outputText value="[Page: #{articlesBean.currentPage} / #{articlesBean.totalPages}]" /></center>
                <br />
            </h:form>
        </f:view>
    </body>
</html>

